<?php
/**
 * Bootstrap
 *
 *
 * @auth kim
 * @version 1.0
 *
 */

/** Bootstrap_Abstract */
require_once('Bootstrap/Abstract.php');

/**
 * Bootstrap class
 *
 * @auth kim
 * @version 1.0
 *
 */
final class Bootstrap extends Bootstrap_Abstract
{
    /**
     * To force to get singleton instance
     *
     */
    static private $_instance = null;

    private function __construct() {}

    private function __clone() {}

    public static function getInstance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
        }

        return self::$_instance;
    }

    /**
     * Application run
     * Combining the zend components
     *
     */
    public function run()
    {
        parent::run();

        /** Zend */
        require_once('Zend.php');

        try {

            /**
             * To initail the zend loader
             * usually is to registerAutoload classes
             *
             */
            Zend::initLoader();
            
            /**
             * To initail the Zend_Controller_Front
             *
             */
            Zend::initController();

            /**
             * To initail all the functionalities for the application !
             *
             */
            Zend::initPlugin();

            /**
             * To output the result through Zend_Controller_Front::dispatch()
             *
             */
            Zend::output();

        } catch (Exception $e) {

            /**
             * To handle all the exceptions
             *
             */
            Zend::handleException($e);
        }

    }



}

